# 量化的 python 基础

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt


def parseNumpy():
    a = np.array([2, 3, 5, 7, 1])
    print(a[0])
    print(a[1:3])
    print(a.dtype)
    print(a.mean())
    print(a.std())
    b = np.array([1, 2, 3])
    c = b * 4
    print(c)

def parsePandas():
    stocks = pd.Series([54.74,190.9,173.14,1050.3,181.86,1139.49],
                       index=['腾讯','阿里巴巴','苹果','谷歌','Facebook','亚马逊'])
    print(stocks.describe())

def parseMatplot():
    x = [1,2,3,4]
    y = [1,4,9,16]
    plt.plot(x,y,'-.ro')
    plt.axis([0,6,0,20])
    plt.show()

if __name__ == '__main__':
    parseMatplot()



